home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’93 / HackTV & Example panel comp. / ExampleVideoPanelPrivate.h < prev    next >
Text File  |  1993-08-18  |  4KB  |  176 lines

  1. /*
  2.     File:        ExampleVideoPanelPrivate.h
  3.  
  4.     Contains:    Private header file for example video panel component routines.
  5.  
  6.     Written by:    Gary Woodcock
  7.  
  8.                 Refer to develop Issue 14, "Video Digitizing Under QuickTime",
  9.                 for details on this code.
  10.                 
  11.     Copyright:    © 1992-1993 by Apple Computer, Inc., all rights reserved.
  12.  
  13.     Change History (most recent first):
  14.  
  15. */
  16.  
  17. //-----------------------------------------------------------------------
  18. // Includes
  19.  
  20. #ifndef    _EXAMPLEVIDEOPANELPRIVATE_
  21. #define    _EXAMPLEVIDEOPANELPRIVATE_
  22.  
  23. #include <QuickTimeComponents.h>
  24. #include "DebugFlags.h"
  25.  
  26. //-----------------------------------------------------------------------
  27. // Private constants
  28.  
  29. // Base resource ID
  30. enum
  31. {
  32.     kBaseResID = 500
  33. };
  34.  
  35. // Maximum number of instances that can be opened
  36. enum
  37. {
  38.     kMaxExampleVideoPanelInstances = 1
  39. };
  40.  
  41. // Component and interface revision levels
  42. enum
  43. {
  44.     exampleVideoPanelInterfaceRevision = 0x00010001    
  45. };
  46.  
  47. enum
  48. {
  49.     kGenericError = -1L    // Handy return code
  50. };
  51.  
  52. // DITL ID
  53. enum
  54. {
  55.     kExampleVideoPanelDITLID = kBaseResID
  56. };
  57.  
  58. // DITL items
  59. enum
  60. {
  61.     kZeroBlackButton = 1,
  62.     kResetButton,
  63.     kSeparator,
  64.     kTextBlurb
  65. };
  66.  
  67. enum
  68. {
  69.     kDKey = 0x02,
  70.     kRKey = 0x0F
  71. };
  72.  
  73. //-----------------------------------------------------------------------
  74. // Private types
  75.  
  76. typedef    struct    PanelGlobals
  77. {
  78.     Component            self;
  79.     SeqGrabComponent    seqGrabber;
  80.     SGChannel            videoChannel;
  81.     short                resRefNum;
  82.     Pattern                grayPat;
  83.     unsigned short        savedBlackLevel;
  84. }
  85. PanelGlobals, *PanelGlobalsPtr, **PanelGlobalsHdl;
  86.  
  87. //-----------------------------------------------------------------------
  88. // Private prototypes
  89.  
  90. #ifdef DEBUG_ME
  91.  
  92. // Only need this prototype if we're running linked (for debugging)
  93. pascal ComponentResult
  94. ExampleVideoPanelDispatcher (ComponentParameters *params, Handle storage);
  95.                                          
  96. #endif DEBUG_ME
  97.                                              
  98. pascal ComponentResult
  99. _ExampleVideoPanelOpen (Handle storage, ComponentInstance self);
  100.     
  101. pascal ComponentResult
  102. _ExampleVideoPanelClose (Handle storage, ComponentInstance self);
  103.  
  104. pascal ComponentResult
  105. _ExampleVideoPanelCanDo (short selector);
  106.  
  107. pascal ComponentResult
  108. _ExampleVideoPanelVersion (void);
  109.  
  110. pascal ComponentResult
  111. _ExampleVideoPanelGetDitl (Handle storage, Handle *ditl);
  112.                                                          
  113. pascal ComponentResult
  114. _ExampleVideoPanelGetTitle (Handle storage, Str255 title);
  115.                                                          
  116. pascal ComponentResult
  117. _ExampleVideoPanelCanRun (Handle storage, SGChannel c);
  118.                                                          
  119. pascal ComponentResult
  120. _ExampleVideoPanelInstall (Handle storage, SGChannel c, DialogPtr d, short itemOffset);
  121.                                                          
  122. pascal ComponentResult
  123. _ExampleVideoPanelEvent (Handle storage, SGChannel c, DialogPtr d, short itemOffset,
  124.     EventRecord *theEvent, short *itemHit, Boolean *handled);
  125.                                                          
  126. pascal ComponentResult
  127. _ExampleVideoPanelItem (Handle storage, SGChannel c, DialogPtr d, short itemOffset, short itemNum);
  128.                                                          
  129. pascal ComponentResult
  130. _ExampleVideoPanelRemove (Handle storage, SGChannel c, DialogPtr d, short itemOffset);
  131.                                                          
  132. pascal ComponentResult
  133. _ExampleVideoPanelSetGrabber (Handle storage, SeqGrabComponent sg);
  134.                                                          
  135. pascal ComponentResult
  136. _ExampleVideoPanelSetResFile (Handle storage, short resRef);
  137.                                                          
  138. pascal ComponentResult
  139. _ExampleVideoPanelGetSettings (Handle storage, SGChannel c, UserData *ud, long flags);
  140.                                                         
  141. pascal ComponentResult
  142. _ExampleVideoPanelSetSettings (Handle storage, SGChannel c, UserData ud, long flags);
  143.                                                          
  144. pascal ComponentResult
  145. _ExampleVideoPanelValidateInput (Handle storage, Boolean *ok);
  146.                                                          
  147. static OSErr
  148. FakeButtonHit (ControlHandle theButton);
  149.  
  150. static OSErr
  151. FakeDialogButtonHit (DialogPtr theDialog, short theButtonItem);
  152.  
  153. static void
  154. SetUserItem (DialogPtr theDialog, short theItem, Handle userProc);
  155.  
  156. static Handle
  157. GetItemHandle (DialogPtr theDialog, short theItem);
  158.  
  159. static void
  160. GetItemBox (DialogPtr theDialog, short theItem, Rect *theRect);
  161.  
  162. #ifdef THINK_C
  163. #ifdef DEBUG_ME
  164.  
  165. Component
  166. RegisterExampleVideoPanel (void);
  167.  
  168. #endif DEBUG_ME
  169. #endif THINK_C
  170.  
  171. //-----------------------------------------------------------------------
  172.  
  173. #endif    _EXAMPLEVIDEOPANELPRIVATE_
  174.  
  175. //-----------------------------------------------------------------------
  176.